package com.ittony.blog.mapper;

import com.ittony.blog.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CategoryMapper {

    int insert(Category category);

    int update(Category category);

    Category getCategoryById(Integer id);

    int deleteCategory(Integer id);

    Integer countCategory();

    List<Category> listCategory();

    List<Category> findChildCategory(@Param(value = "id") Integer id);

    Category getCategoryByName(String name);
}
